DELETE
T
FROM
C1_ROLE_PERMISSION AS T
WHERE 1 = 1
AND t.ROLE_ID = :roleId
AND EXISTS
(SELECT
1
FROM
C1_PERMISSION e
WHERE e.id = t.PERMISSION_ID
AND e.`CODE` = :permissionCode
AND e.`SITE_ID` = :siteId)
